import {html, TemplateResult} from 'lit';
import type {Meta, StoryObj} from '@storybook/web-components';
import "../../../echarts/bar/lit-bar-negative.ts"
import {BarNegativeProps} from "../../../echarts/bar/lit-bar-negative.ts";

const meta: Meta<BarNegativeProps> = {
    title: 'Echarts/LitBarNegative',
    tags: ['autodocs'],
    parameters: {
        docs: {
            description: {
                component: 'tooltip，以及其他各类事件暂时无法在storybook中使用，具体请参考echarts的文档',
            },
        }
    },
    render: (args: BarNegativeProps): TemplateResult => {
        return html`<lit-bar-negative
            .chartId=${args.chartId}
            .width=${args.width}
            .height=${args.height}
            .title=${args.title}
            .grid=${args.grid}
            .seriesName=${args.seriesName}
            .yAxisData=${args.yAxisData}
            .seriesData=${args.seriesData}
        />`;
    },
    argTypes: {
        chartId: { control: 'text' },
        width: { control: 'text' },
        height: { control: 'text' },
        title: { control: 'object' },
        grid: { control: 'object' },
        seriesName: { control: 'text' },
        yAxisData: { control: 'object' },
        seriesData: { control: 'object' },
    },
}

export default meta;
type Story = StoryObj<BarNegativeProps>;

export const Default: Story = {
    args: {
        chartId: 'bar-negative-chart',
        width: '1200px',
        height: '600px',
        title: {
            text: 'Bar Chart with Negative Value',
        },
        grid: {
            top: 80,
            bottom: 30,
        },
        seriesName: 'Cost',
        yAxisData: [
            'ten',
            'nine',
            'eight',
            'seven',
            'six',
            'five',
            'four',
            'three',
            'two',
            'one'
        ],
        seriesData: [
            -0.07,
            -0.09,
            0.2,
            0.44,
            -0.23,
            0.08,
            -0.17,
            0.47,
            -0.36,
            0.18
        ],
    },
}
